<template>
  <div class="app-container">
    <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
      <el-tab-pane label="闯关记录" name="rush" />
      <!-- <el-tab-pane label="开箱记录" name="unbox" /> -->
      <div class="tab-content">
        <keep-alive>
          <component :is="curTabcompnents[activeName]" />
        </keep-alive>
      </div>
    </el-tabs>
  </div>
</template>

<script>

import rushRecord from './components/rush-record.vue'

export default {
  name: 'Tab',
  components: { rushRecord },
  data() {
    return {
      activeName: 'rush',
      curTabcompnents: {
        'rush': 'rushRecord'
      }
    }
  },
  created() {
    const tab = this.$route.query.tab
    if (tab) {
      this.activeName = tab
    }
  },

  methods: {
    handleClick(tab) {
      this.activeName = tab.name
    }
  }
}
</script>

<style lang="scss" scoped>
.app-container {
  padding: 0px;
}
</style>
